#pragma once

#include <xml/Stream.h>

class b2Body;
class b2Shape;
struct b2FixtureDef;

namespace physics
{

class Fixture
{
protected:
	b2Body *body;

	std::auto_ptr <b2FixtureDef> fixtureDef;
	std::auto_ptr <b2Shape> shape;

	Fixture();
	virtual ~Fixture();

	bool ParseFixtureDef(xml::Provider *prov, std::auto_ptr <b2FixtureDef> *fixtureDef);

public:
	void MakeSensor();
	void DisableSensor();
	bool IsSensor();
	
	void SetCollisionGroup(int groupID);
	int GetCollisionGroup() const;
	
	void SetFriction(float friction);
	float GetFriction() const;
	
	void SetRestitution(float restitution);
	float GetRestitution() const;

	void SetDensity(float density);
	float GetDensity() const;
};

}	// namespace physics